<template>
    <div class="big-box">
        <div class="header">
            <img src="../../../../../assets/bigScreen/header3.png" alt="" />
			<div class="backBox" @click="goBack"></div>
        </div>
        <div class="backToBox">
            <div class="backTo" @click="gotoHome">
                <div>返回总窗口</div>
            </div>
            <div class="backTo" @click="backToOne">
                <div>返回上一页</div>
            </div>
        </div>
        <div class="centerBox">
            <div class="sreenTitle">服务机构</div>
            <div class="center">
                
	<div class="top">
		<div class="infor" v-if="detail">
			<div class="img">
				<img :src="baseUrl+detail.image" alt="">
			</div>
			<div class="infor-box">
				<div class="box">
					<div class="title">{{detail.name}}</div>
					<div class="tag" v-if="detail.level">{{detail.level}}</div>
				</div>
				<div class="detail">行业类目：{{detail.industryCategory}}</div>
				<div class="detail">机构类型 ：{{detail.agencyType}}</div>
				<!-- <div class="detail">孵化面积：{{detail.acreage}}(平方米) </div> -->
				<div class="address">地址：{{detail.city}}{{detail.address}}</div>
				<!-- <div class="">
                    <a-button @click="jump" type="primary">我要入驻</a-button>
                </div> -->
			</div>
			<!-- <div class="btn">
                <div class="btn-item">
                    <img src="../../../assets/incubation/verification1.png" alt="">
                    <div class="text">
                        孵化 <span class="num">{{detail.itemQuantity}}</span> 个项目
                    </div>
                </div>
                <div class="btn-item">
                    <img src="../../../assets/incubation/verification1.png" alt="">
                    <div class="text">
                       举办了 <span class="num">{{detail.activitiesQuantity}}</span> 个活动
                    </div>
                </div>
            </div> -->
		</div>
	</div>
	<div class="content">
		<div class="combination">
			<div class="zhu"></div>
			<div class="title">关于我们</div>
		</div>
		<div class="infofText" v-html="detail.content"></div>
		<div class="combination">
			<div class="zhu"></div>
			<div class="title">联系我们</div>
		</div>
		<div class="map-container">
			<div class="map-box">
				<map-box :key="mapKey" :markList="[{pos:[detail.longitude,detail.latitude],data:{name:''}}]" />
			</div>
			<div class="info-box">
				<div class="info-box-item"> 
					<div class="img">
						<img src="../../../../../assets/incubation/p1.png" alt="">
					</div>
					<div class="text">电话：{{detail.mobile}}</div>
				</div>
				<div class="info-box-item">
					<div class="img">
						<img src="../../../../../assets/incubation/p2.png" alt="">
					</div>
					<div class="text">邮箱：{{detail.email}}</div>
				</div>
				<div class="info-box-item">
					<div class="img">
						<img src="../../../../../assets/incubation/p3.png" alt="">
					</div>
					<div class="text">地址：{{detail.city}}{{detail.address}}</div>
				</div>
			</div>
		</div>
	</div>
            </div>
        </div>
    </div>
</template>


<script setup>
	import headerBox from "../../../../../components/header.vue"
	import mapBox from "../../../../../components/map.vue"
	import headerImg from "../../../../../components/headerImg.vue"
	import footerBox from "../../../../../components/footer-box.vue"
	import titleAddBox from "../../../../../components/title-addBox.vue"
	import {
		ref,
		reactive,
		onBeforeMount
	} from "vue"
	import { baseUrl } from '../../../../../../config';
	import {
		agencyBase
	} from "../../../../../api/orgService"
	import {
		useRouter,
		useRoute
	} from "vue-router"
	const router = useRouter()
	const route = useRoute()
	const mapKey = ref(1)
	const tabvalue = ref(1)
	const detail = ref({longitude:116.397428,latitude: 39.90923})
	const id = ref('')
	const jump = (url) => {
		console.log(url)
		// return false
		router.push(url)
	}

	async function getData() {
		console.log(id.value);
		agencyBase(id.value).then((response) => {
			if (response.code == 200) {
				detail.value = response.data
				if (response.data.longitude == null) {
					detail.value.longitude = 116.397428
				} else {
					detail.value.longitude = Number(detail.value.longitude)
				}
				if (response.data.latitude == null) {
					detail.value.latitude = 39.90923
				} else {
					detail.value.latitude = Number(detail.value.latitude)
				}
				mapKey.value++;
			} else {}
		})
	}

    const gotoHome = (act) => {
    router.push({
        path: '/bigScreenIndex',
    })
}
const backToOne = (act) => {
    router.go(-1)
}

const goBack = () => {
    router.push('/chart')
}

	onBeforeMount(() => {
		id.value = route.query.id
		getData()
	})
</script>

<style scoped lang="scss">
@font-face {
    font-family: "ffa";
    src: url(../../../assets/bigScreen/fonts/DS-DIGIB.TTF);
}
ul,
li {
    list-style: none;
}
.big-box {
    background-color: #071c3b;
    height: 100vh;
}
.header {
	position: relative;
    text-align: center;
    position: relative;
    height: 19.1rem;

	.backBox {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 70rem;
        height: 10rem;
        cursor: pointer;
    }

    > img {
        width: 100%;
        max-height: 100%;
        margin-top: -1.1rem;
        image-rendering: -moz-crisp-edges; /* Firefox */
        image-rendering: -o-crisp-edges; /* Opera */
        image-rendering: -webkit-optimize-contrast; /* Webkit (non-standard naming) */
        image-rendering: crisp-edges;
        -ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
    }
}
.centerBox {
    width: 96%;
    margin: 0 auto;
    position: absolute;
    top: 14rem;
    left: 2%;
    .sreenTitle {
        background-image: url("../../../../../assets/bigScreen/sreenTitle.png");
        background-size: 100% 100%;
        height: 3.8rem;
        padding-left: 35px;
        font-weight: 600;
        color: #fff;
        display: flex;
        align-items: center;
    }
    .center {
        margin-top: 1rem;
        height: calc(100vh - 20rem);
        border: 1px solid;
        border-image: linear-gradient(
                130deg,
                #2385df 0%,
                rgba(35, 133, 223, 0.65) 92%
            )
            1;
        overflow-y: scroll;
        padding: 20px;
     
	.top {
		width: 100%;
		height: 46.8rem;
		// background: #F6FAFF;
		display: flex;
	}

	.tag {
		border: 1px solid #037AFF;
		padding: 0.5rem 1rem;
		color: #037AFF;
		border-radius: 5px;
		font-size: 12px;
	}

	.zhu {
		width: 0.5rem;
		height: 3rem;
		background: #037AFF;
		margin-right: 2rem;
	}

	.infor {
		display: flex;
		align-items: center;
		width: 140rem;
		margin: auto;

		.img {
			width: 40.3rem;
			height: 40.3rem;
			background: #ccc;

			img {
				width: 100%;
				height: 100%;
			}
		}

		.infor-box {
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			height: 40.3rem;
			flex: auto;
			margin-left: 3rem;
            color: #fff;

			.box {
				display: flex;
				align-items: center;
				margin-bottom: 2.5rem;

				.title {
					font-size: 2.6rem;
					font-weight: 700;
					color: #fff;
					margin-right: 2rem;
				}
			}

			.detail {}

			.address {
				margin-top: 2.5rem;
			}

			.thumbnail {
				width: 7.9rem;
				height: 7.9rem;
				background: #ccc;
				box-sizing: border-box;
				border: 1px solid #037AFF;

				img {
					width: 100%;
					height: 100%;
				}
			}
		}

		.btn {
			.btn-item {
				display: flex;
				flex-direction: column;
				justify-content: space-evenly;
				align-items: center;
				width: 20.9rem;
				height: 12.7rem;
				background: #FFFFFF;
				border: 1px solid rgba(234, 234, 234, 0.5);
				text-align: center;

				&:first-child {
					margin-bottom: 2rem;
				}

				img {
					width: 8rem;
					height: 6.8rem;
				}

				.num {
					color: #037AFF;
				}
			}
		}
	}

	.content {
		width: 140rem;
		margin: auto;
	}

	.combination {
		display: flex;
		align-items: center;
		border-bottom: 1px solid #4494FF46;
		padding: 2rem 0;

		.title {
			font-size: 3.6rem;
			font-weight: 700;
			color: #fff;
		}
	}

	.infofText {
		font-size: 1.8rem;
		line-height: 3.6rem;
		text-align: justify;
		/* 浏览器可能不支持 */
		color: #fff;
		margin: 2rem 0;
	}

	.map-container {
		display: flex;
		//   width: 136rem;
		height: 46rem;
		margin: 4rem auto;

		.map-box {
			flex: 1;
			background: #ffffff;
			padding: 1rem;
		}

		.info-box {
			display: flex;
			flex-direction: column;
			justify-content: center;
			flex: 1;
			height: 100%;
			margin-left: 1.5rem;
			color: #ffffff;
			padding: 1rem;

			&-item {
				display: flex;
				align-items: center;

				.img {
					width: 4.5rem;
					height: 4.5rem;

					img {
						width: 100%;
						height: 100%;
					}
				}

				.text {
					max-width: 54.6rem;
					font-size: 1.8rem;
					margin-left: 2rem;
					flex: auto;
					padding: 4.6rem 0;
		border-bottom: 1px solid #4494FF46;
				}
			}
		}
	}
    }
    ::-webkit-scrollbar {
        width: 5px;
        height: 10px;
    }

    /* 滚动条轨道 */
    ::-webkit-scrollbar-track {
        background-color: #234470;
    }

    /* 滚动条滑块 */
    ::-webkit-scrollbar-thumb {
        background-color: #061c57;
    }

    /* 鼠标悬停在滚动条上的滑块 */
    ::-webkit-scrollbar-thumb:hover {
        background-color: #555;
    }
}
.backToBox {
    position: absolute;
    top: 8rem;
    right: 2%;
    display: flex;
    z-index: 10;
    .backTo {
        background-image: url("../../../../../assets/bigScreen/backTo.png");
        color: #2dccff;
        background-size: 100% 100%;
        width: fit-content;
        padding: 2px 40px 10px 10px;
        font-weight: 600;
        cursor: pointer;
        margin-left: 10px;
        div {
            padding-top: 5px;
        }
    }
}
</style>
